﻿using rmTest.Common.ModelUtil;
using rmTest.First.Access;
using rmTest.First.ServiceInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace rmTest.First.ServiceFactory.SqlServer
{

    public class BaseService : IBaseService
    {
        public List<T> GetList<T>() where T : BaseModel
        {
            return BaseDataAccess.GetList<T>();
        }
        public T Get<T>(int id) where T : BaseModel
        {
            return BaseDataAccess.Get<T>(id);
        }

        public int InsertDataByModel<T>(T t) where T : BaseModel
        {
            return BaseDataAccess.InsertDataByModel<T>(t);
        }
        public int UpdateDataByModel<T>(T t) where T : BaseModel
        {
            return BaseDataAccess.UpdateDataByModel<T>(t);
        }
        public int Delete<T>(int id) where T : BaseModel
        {
            return BaseDataAccess.Detele<T>(id);
        }
    }
}
